/*LICENSE_BEGIN
 * ******************************************************************
 * Copyright 2006 by the Dainamite Robocup-Team at the
 * DAI-Labor, TU-Berlin (www.dai-labor.de)
 * 
 * Members of Dainamite are:
 * Holger Endert
 * Robert Wetzker
 * Thomas Karbe
 * Axel Heßler
 * Philippe Bütter
 * Felix Brossmann
 * 
 * Licensed under the GNU GPL (General Public License) Free Software 
 * License, Version 2. You may use this file only in compliance with 
 * the License. You may obtain a copy of the License at:
 * 
 * http://www.fsf.org/licensing/licenses/gpl.txt
 * ******************************************************************
LICENSE_END*/
package robocup.component.speechacts.coachlanguage;

import java.util.LinkedList;

public class Directive {

	private boolean doIt = false;

	private boolean teamOur = false;

	private UnumSet unumSet = null;

	private LinkedList<ActionElement> actionList = new LinkedList<ActionElement>();

	private String clangStr = "";

	public void addAction(ActionElement a) {
		actionList.add(a);
	}

	public LinkedList<ActionElement> getActionList() {
		return actionList;
	}

	public void setActionList(LinkedList<ActionElement> actionList) {
		this.actionList = actionList;
	}

	public String getClangStr() {
		return clangStr;
	}

	public void setClangStr(String clangStr) {
		this.clangStr = clangStr;
	}

	public boolean isDoIt() {
		return doIt;
	}

	public void setDoIt(boolean doIt) {
		this.doIt = doIt;
	}

	public boolean isTeamOur() {
		return teamOur;
	}

	public void setTeamOur(boolean teamOur) {
		this.teamOur = teamOur;
	}

	public UnumSet getUnumSet() {
		return unumSet;
	}

	public void setUnumSet(UnumSet unumSet) {
		this.unumSet = unumSet;
	}

	public String toString() {
		StringBuffer buf = new StringBuffer();
		String dont = "";
		String team = "";

		if (this.clangStr.matches("")) {
			if (this.doIt)
				dont = "do ";
			else
				dont = "dont ";
			if (this.teamOur)
				team = "our";
			else
				team = "opp";
			buf.append("(" + dont + team + this.unumSet.toString());
			for (ActionElement action : this.actionList) {
				buf.append(" " + action.toString());
			}
			buf.append(")");
		} else
			buf.append(this.clangStr);

		return buf.toString();
	}

}
